package com.controller;

import com.domain.Item;
import com.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class ItemController {
    @Autowired
    private ItemService itemService;

    @RequestMapping("/findById/{id}")
    public String findById(@PathVariable("id") Integer id, Model model){
        Item item = itemService.findById(id);
        model.addAttribute("item",item);
        return "success";
    }
    public void findAll(){
        System.out.println("查询所有");
    }
}
